<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="minipost.user.AdministratorBean" %>
<%@ page import="minipost.user.model.Administrator" %>
<jsp:useBean id="adminBean" class="minipost.user.AdministratorBean" scope="page" />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>welcome page</title>
</head>
<body>
	<% 
		request.setCharacterEncoding("GB2312");
   		request.setCharacterEncoding("GB2312");
   		String name = request.getParameter("name");
   		String pwd = request.getParameter("pass");
   		Administrator admin = new Administrator();
   		admin.setUsername(name);
   		admin.setPassword(pwd);
   		boolean isValid = adminBean.isValidUser(admin);
   		
   		if (isValid) {
   			out.write("<p>hello, " + admin.getUsername() + "<p>");
   		} else {
   			out.write("<p>the user name or password is invalid.<p>");
   		}
   %>
</body>
</html>